import type { PageParams,GoodsItem, PageResult } from "@/types/global"

import type { BannerItem, CategoryItem, GuessItem, HotItem } from "@/types/home"
import { http } from "@/utils/http"

export type GuessItem=GoodsItem
type HotParams = PageParams & {
	subType ?: string
}
export const getHomeBannerAPI = (distributionSite = 1) => {
	return http<BannerItem[]>({
		method: "GET",
		url: "/home/banner",
		data: {
			distributionSite
		}
	})

}
export const getCategoryApi = () => {
	return http<CategoryItem[]>({
		method: "GET",
		url: "/home/category/mutli"
	})
}
export const hotApi = () => {
	return http<HotItem[]>({
		method: "GET",
		url: '/home/hot/mutli',
	})
}
export const getGuessLikeApI = (data ?: PageParams) => {
	return http<PageResult<GuessItem>>({
		method: "GET",
		url: '/home/goods/guessLike',
		data
	})
}

export const getHotRecommandApi = (url : string, data ?: HotParams) => {
	return http<HotResult>({
		method: "GET",
		url,
		data
	})
}